<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>基础数据管理-客户管理</title>
<%@ include file="../common/config.jsp"%>
<%@ include file="../common/pageable.jsp"%>
<script type="text/javascript">
    /**
     * Callback function that displays the content.
     *
     * Gets called every time the user clicks on a pagination link.
     *
     * @param {int} page_index New Page index
     * @param {jQuery} jq the container with the pagination links as a jQuery object
     */
    function pageselectCallback(page_index, jq){
    	var oldPageIndex = $("#pageInfo_pageIndex").val();
        if (page_index != oldPageIndex) {
        	$("#pageInfo_pageIndex").val(page_index);
        	$("#customerList").submit();
        }
        return false;
    }

     function querySubmit() {
    	 $("#pageInfo_pageIndex").val("0");
    	 $("#customerList").submit();
    	 return false;
     }
</script>
</head>
<body>
    <div class="subnav" align="left">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="100%" align="left" height="31">&nbsp;<img src="images/title-pk.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt1">基础数据管理</span>
			&nbsp;<img src="images/leftico2.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt2">客户管理</span></td>
		  </tr>
		</table>
      </div>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="right"><input type="button" value="添加新客户" onclick='javascript:window.location.href="addCustomer.action"'  class="inputlong" /></td>
  </tr>
</table>
<div class="main_1">
  <s:form action="customerList.action" name="condition" theme="simple">
  <s:hidden id="pageInfo_pageIndex" name="pageInfo.pageIndex" />
  <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D3DEEF">
    <tr align="left">
      <td bgcolor="#FFFFFF">
      	<table width="100%" border="0" cellspacing="1" cellpadding="2">
        <tr>
          <td width="13%" align="right">地区分类</td>
          <td width="15%" >
          	<s:select name="condition.area"
          		list='#{"":"-请选择-","北京市":"北京市","天津市":"天津市","河北省":"河北省","山西省":"山西省","内蒙古自治区":"内蒙古自治区","辽宁省":"辽宁省","吉林省":"吉林省","黑龙江省":"黑龙江省","上海市":"上海市","江苏省":"江苏省","浙江省":"浙江省","安徽省":"安徽省","福建省":"福建省","江西省":"江西省","山东省":"山东省","河南省":"河南省","湖北省":"湖北省","湖南省":"湖南省","广东省":"广东省","广西壮族自治区":"广西壮族自治区","海南省":"海南省","重庆市":"重庆市","四川省":"四川省","贵州省":"贵州省","云南省":"云南省","西藏自治区":"西藏自治区","陕西省":"陕西省","甘肃省":"甘肃省","青海省":"青海省","宁夏回族自治区":"宁夏回族自治区","新疆维吾尔自治区":"新疆维吾尔自治区","台湾省":"台湾省","香港特别行政区":"香港特别行政区","澳门特别行政区":"澳门特别行政区"}'
          		cssClass="selecte120"/>
          </td>
          <td width="13%" align="right">产品分类</td>
          <td width="15%" >
          	<s:select name="condition.conditionCategory"
          		list="categoryList"
          		listKey="id"
          		listValue="name"
          		headerKey="-1"
          		headerValue="-请选择-" 
          		cssClass="selecte120"/>
          </td>
    	  <td width="13%" align="right">客户名称</td>
    	  <td width="20%">
            <s:textfield name="condition.name" size="20" />
          </td>
          <td align="right">
            <input type="button" value="查询" class="input1" onclick="querySubmit()" />
          </td>
        </tr>
      </table>
      </td>
    </tr>
  </table>
  </s:form>
</div>
<div class="ksglxx2">

  <table width="100%" cellpadding="0" cellspacing="1" border="0" class="ksglxx2a">
        <tr class="ksglxx2bg">
           <th width="20%" align="left">客户名称</th>
           <th width="25%" align="left">地区分类</th>
           <th width="20%" align="left">产品分类</th>
           <th width="17%" align="left">地址</th>
           <th width="18%" align="left"></th>
        </tr>
        <s:iterator value="customerList" id="customer" status="st">
          <s:if test="#st.Odd">
            <tr class="odd">
              <td><s:property value="#customer.name" /></td>
              <td><s:property value="#customer.area" /></td>
              <td><s:property value="#customer.conditionCategory" /></td>
              <td><s:property value="#customer.address" /></td>
              <td align="center">
                <a class="b" href='viewCustomer.action?customerId=<s:property value="#customer.id" />'>
                  <img src="images/view.gif" alt="Edit" border="0" align="absmiddle" /></a>&nbsp;&nbsp;
                <a class="b" href='editCustomer.action?customerId=<s:property value="#customer.id" />'>
                  <img src="images/Edit.gif" alt="Edit" border="0" align="absmiddle" /></a>&nbsp;&nbsp;
                <a class="b" href='deleteCustomer.action?customerId=<s:property value="#customer.id" />'>
                  <img src="images/Delete.gif" alt="Delete" border="0" align="absmiddle" /></a>
         	  </td>
            </tr>
          </s:if>
          <s:else>
            <tr class="even">
              <td><s:property value="#customer.name" /></td>
              <td><s:property value="#customer.area" /></td>
              <td><s:property value="#customer.conditionCategory" /></td>
              <td><s:property value="#customer.address" /></td>
              <td align="center">
                <a class="b" href='viewCustomer.action?customerId=<s:property value="#customer.id" />'>
                  <img src="images/view.gif" alt="Edit" border="0" align="absmiddle" /></a>&nbsp;&nbsp;
                <a class="b" href='editCustomer.action?customerId=<s:property value="#customer.id" />'>
                  <img src="images/Edit.gif" alt="Edit" border="0" align="absmiddle" /></a>&nbsp;&nbsp;
                <a class="b" href='deleteCustomer.action?customerId=<s:property value="#customer.id" />'>
                  <img src="images/Delete.gif" alt="Delete" border="0" align="absmiddle" /></a>
         	  </td>
            </tr>
           </s:else>
         </s:iterator>
        </table>
		
		<!--分页开始-->
		<div style="float:right;">
			<br style="clear:both;" /> 
			<div id="Pagination"></div> 
		</div>
		<!--分页结束-->

</div>
</body>
</html>
